//
//  TKHttpService.h
//  TKIMSDK
//
//  Created by TryHone on 16/7/2.
//  Copyright © 2016年 TryHone. All rights reserved.
//

#import <Foundation/Foundation.h>
@interface TKHttpService : NSObject
@property(nonatomic,strong) TKIMUser *transUser;//中转用户
//获取单例类
+ (instancetype)sharedInstance;

//外围接口调用获取登录用户
-(void)getUser:(NSString *)appkey udid:(NSString*)udid username:(NSString*)username password:(NSString*)psw
      memberId:(NSString*)memberId callBack:(TKIMCallBack)callBack;

//内部接口获取联系人列表
-(void)uerList:(NSString*)appkey cust_code:(NSString*)cust_code callBack:(TKIMCallBack)callBack;

//获取会话列表
-(void)converseList:(NSString*)app_key cust_code:(NSString*)cust_code callBack:(TKIMCallBack)callBack;

//设置到服务器是否接收消息
-(void)setAccpetMsg:(NSString*)app_key cust_code:(NSString*)cust_code msgtypeid:(NSString*)msgtypeid  state:(NSString*)state callBack:(TKIMCallBack)callBack;

//内部测试模拟第三方调用
-(void)initData:(NSString*)token appkey:(NSString*)appkey apptype:(NSString*)apptype custcode:(NSString*)custcode callback:(TKIMCallBack)callBack;


//上传临时token
-(void)uploadToken:(NSString*)appkey deviceToken:(NSString*)deviceToken;

- (void)addFriend:(NSString*)service_code  cust_code:(NSString*)cust_code callBack:(TKIMCallBack)callBack;
//上传消息类型的是否读状态
-(void)setMsgState:(NSString*)app_key msgType:(NSString*)jid callback:(TKIMCallBack)callBack;

-(void)getOfAccout:(NSString*)appkey invoke_ofserver:(NSString*)invoke_ofserver username:(NSString*)username password:(NSString*)password nickname:(NSString*)nickname callback:(TKIMCallBack)back;

-(void)addFriend:(NSString*)service_code cust_code:(NSString*)cust_code callBack:(TKIMCallBack)callBack;

-(void)getComplianceMsg:(NSString*)appkey username:(NSString*)username callBack:(TKIMCallBack)callBack;
/**
 *  @author Alan, 16-11-02 20:11:11
 *
 *  @brief 获取custom端的公共服务
 *
 *  @param puid    登录账号唯一标识
 *  @param appkey  应用唯一标识
 *  @param apptype 应用类型
 *  @param back    回调
 */
-(void)getCoustomeCommonService:(NSString*)puid  appkey:(NSString*)appkey apptype:(NSString*)apptype callback:(TKIMCallBack)back;
/**
 *  @author Alan, 16-12-05 15:12:23
 *
 *  @brief 获取公共配置参数
 *
 *  @param back 回调
 */
-(void)getCommonAllocation:(TKIMCallBack)back;

/**
 *  @author Alan, 17-02-07 18:02:23
 *
 *  @brief 获取客服列表(新湖专用)
 *
 *  @param appkey appkey
 *  @param back   回调
 */
-(void)getCoustomeServiceList:(NSString*)appkey callback:(TKIMCallBack)back;


//公共入参
#pragma mark--设置公共入参
+(NSMutableDictionary*)getParam;
+(NSString*)app_key;
+(NSString*)app_type;
+(NSString*)cust_code;
+(NSString*)tokenUDID;
+(NSString*)app_puid;
+(void)extParam:(NSDictionary*)dict;


#pragma mark--第二版接口
/**
 *  @author Alan, 2016年08月05日19:36:45
 *
 *  @brief SDK 启动
 *
 *  @param appkey 应用appkey
 *  @param back   回调
 */
-(void)start:(NSString*)appkey callback:(TKIMCallBack)back;


#pragma mark--扩展的外围接口

/**
 *  @author TryHone, 2016年09月21日18:48:03
 *
 *  @brief 股票订阅
 *
 *  @param app_key      app-key 应用key
 *  @param user_account 账号
 *  @param stock_code   股票代码
 *  @param up_price     股票上涨预警价
 *  @param down_price   股票下跌预警价
 *  @param up_percent   股票日涨幅预警值
 *  @param down_percent 股票日跌幅预警值
 *  @param back         回调
 */

-(void)subscribeStockInfo:(NSString*)app_key userAccount:(NSString*)user_account stockCode:(NSString*)stock_code up_price:(NSString*)up_price down_price:(NSString*)down_price up_percent:(NSString*)up_percent down_percent:(NSString*)down_percent callback:(TKIMCallBack)back;

/**
 *  @author TryHone, 16-09-23 17:09:57
 *
 *  @brief 消息开关
 *
 *  @param app_key   应用appkey
 *  @param state     开关状态
 *  @param msgtypeid 消息类型ID
 *  @param set_type  开关类型 1 总开关  2 单个开关
 *  @param back      回调
 */
-(void)changeToggleListState:(NSString*)app_key state:(NSString*)state msgtypeid:(NSString*)msgtypeid setType:(NSString*)set_type callback:(TKIMCallBack)back;

/**
 *  @author Alan, 16-11-18 21:11:22
 *
 *  @brief 对客服评价
 *
 *  @param sessionid 会话ID
 *  @param sid       sid
 *  @param cid       cid
 *  @param score     评分
 *  @param describe  描述
 *  @param back      回调
 */
-(void)evaluationSatisfaction:(NSString*)sessionid sid:(NSString*)sid cid:(NSString*)cid score:(NSString*)score describe:(NSString*)describe spuid:(NSString*)spuid  cpuid:(NSString*)cpuid msgId:(NSString*)msgId callback:(TKIMCallBack)back;


/**
 *  @author Alan, 16-12-03 19:12:39
 *
 *  @brief 业务心跳
 *
 *  @param puid         puid
 *  @param apptype      app类型
 *  @param callBackFunc 回调
 */
-(void)keepHeart:(NSString*)puid apptype:(NSString*)apptype callBackFunc:(TKIMCallBack)back;


/**
 *  @author Alan, 17-03-21 10:03:24
 *
 *  @brief 更新消息已读
 *
 *  @param serialNo 流水号
 *  @param ofid     ofid
 *  @param back     回调
 */
-(void)updateMsgClickState:(NSString*)serialNo ofid:(NSString*)ofid callback:(TKIMCallBack)back;

/**
 *  @author Alan, 17-04-13 10:04:46
 *
 *  @brief 上传消息点击事件
 *
 *  @param userInfo 推送代理获取到的数据
 *  @param back     回调
 */
-(void)uploadApnsMsgClickEvent:(NSDictionary*)userInfo type:(NSString*)type  callback:(TKIMCallBack)back;


/**
 *  @author Alan, 17-05-10 17:05:07
 *
 *  @brief 获取推送列表显示与否
 *
 *  @param back 回调
 */
-(void)pushTypeShowControl:(TKIMCallBack)back;

#pragma mark--辅助方法
/**
 *  @author Alan, 17-02-07 18:02:28
 *
 *  @brief 插入用户到数据库
 *
 *  @param data    数组
 *  @param calBack 回调
 */
-(void)dealWithOnlineChatsData:(NSArray*)data callBack:(void(^)(NSMutableArray *array)) calBack;

#pragma mark--优化版登陆
//app启动就需要调用的方法
-(void)loginBusiness:(TKIMCallBack)back;
-(void)loginBusinessWithCustCode:(NSString *)custCode callBack:(TKIMCallBack)back;


#pragma mark--光大新增
-(void)registerChannelAccount:(NSString*)userCode callback:(TKIMCallBack)back;
-(void)loginChannelAccount:(NSString*)userCode callback:(TKIMCallBack)back;
-(void)loginTouristAccount:(TKIMCallBack)back;
-(void)bindChannelAccount:(NSString*)userCode custCode:(NSString*)custCode password:(NSString*)password callback:(TKIMCallBack)back;
-(void)unBindChannelAccount:(NSString*)userCode custCode:(NSString*)custCode callback:(TKIMCallBack)back;
-(void)queryBindAccountList:(NSString *)puid callback:(TKIMCallBack)back;
//获取推送列表
-(void)pushList:(NSString*)appkey cust_code:(NSString*)cust_code callBack:(TKIMCallBack)callBack;
//设置是否接收
-(void)setAccpetPushMsg:(NSString*)app_key cust_code:(NSString*)cust_code msgtypeid:(NSString*)msgtypeid  state:(NSString*)state callBack:(TKIMCallBack)callBack;


@end
